
import { request } from "./request";
export function getRightsList(type) {
  return request({
    method: "get",
    url: `rights/${type}`,
  });
}

export function getRolesList() {
  return request({
    method: "get",
    url: "roles",
  });
}

export function deleteRoleUser(id){
  return request({
    method: "delete",
    url: `roles/${id}`,
  })
}


export function putCreateUser(newUser) {
 
  return request({
    method: "post",
    url: "roles",
    data: newUser,
  })
}

export function deleteRolesById(roleId,rightId){
   return request({
     method: "delete",
     url: `roles/${roleId}/rights/${rightId}`
   })
}

export function appointRights(roleId,data) { 
  return request({
    method: "post",
    url: `roles/${roleId}/rights`,
    data: data,
  })
 }


